min2      MACRO  value1,value2,extra
          LOCAL  endIfLess
; put smaller of value1 and value2 in EAX

          IFB   <value1>
          .ERR  <first argument missing in min2 macro>
          EXITM
          ENDIF

          IFB   <value2>
          .ERR  <second argument missing in min2 macro>
          EXITM
          ENDIF

          IFNB   <extra>
          .ERR  <more than two arguments in min2 macro>
          EXITM
          ENDIF

          mov  eax, value1   ;; first value to EAX
          cmp  eax, value2   ;; value1 <= value2?
          jle  endIfLess     ;; done if so
          mov  eax, value2   ;; otherwise value2 smaller
endIfLess:
          ENDM

